﻿

(function($) {
	$.fn.validationEngineLanguage = function() {};
	$.validationEngineLanguage = {
		newLang: function() {
			$.validationEngineLanguage.allRules = 	{"required":{    			// Add your regex rules here, you can take telephone as an example
						"regex":"none",
						"alertText":"* 必须填入项",
						"alertTextCheckboxMultiple":"* 请选择一个选项",
						"alertTextCheckboxe":"* 必须勾选这一选项"},
					"length":{
						"regex":"none",
						"alertText":"*只允许 ",
						"alertText2":" ~ ",
						"alertText3": " 个字符"},
					"maxCheckbox":{
						"regex":"none",
						"alertText":"* 个勾选已经达到"},	
					"minCheckbox":{
						"regex":"none",
						"alertText":"* 最少选择 ",
						"alertText2":" 个选项"},	
					"confirm":{
						"regex":"none",
						"alertText":"* 两次填入的并不一致"},		
					"telephone":{
						"regex":"/^[0-9\-\(\)\ ]+$/",
						"alertText":"* 不是合适的电话号码格式"},	
					"email":{
						"regex":"/^[a-zA-Z0-9_\.\-]+\@([a-zA-Z0-9\-]+\.)+[a-zA-Z0-9]{2,4}$/",
						"alertText":"* 非合法的EMAIL地址"},	
					"date":{
                         "regex":"/^[0-9]{4}\-\[0-9]{1,2}\-\[0-9]{1,2}$/",
                         "alertText":"* 非法的日期格式，必须为 YYYY-MM-DD"},
					"onlyNumber":{
						"regex":"/^[0-9\ ]+$/",
						"alertText":"* 只能为数字"},	
					"noSpecialCaracters":{
						"regex":"/^[0-9a-zA-Z]+$/",
						"alertText":"* 只能为26字母或数字"},	
					"ajaxUser":{
						"file":"validateUser.php",
						"extraData":"name=eric",
						"alertTextOk":"* 用户名合法",	
						"alertTextLoad":"* 载入中，请稍候",
						"alertText":"* 已存在用户名"},	
					"ajaxName":{
						"file":"validateUser.php",
						"alertText":"* 已存在用户名",
						"alertTextOk":"* 可以使用该用户名",	
						"alertTextLoad":"* 载入中，请稍候"},		
					"onlyLetter":{
						"regex":"/^[a-zA-Z\ \']+$/",
						"alertText":"* 只接受26个字母"},
					"validate2fields":{
    					"nname":"validate2fields",
    					"alertText":"* 必须填入姓名两个选项"}	
					}	
					
		}
	}
})(jQuery);

$(document).ready(function() {	
	$.validationEngineLanguage.newLang()
});